AssemblerGraphic = AssemblerGraphic or Class("AssemblerGraphic", Assembler)

---@diagnostic disable-next-line: duplicate-set-field
function AssemblerGraphic:ctor(graphic)
    Assembler.ctor(self, graphic)
end

function AssemblerGraphic:getUVs()
    -- graphic绘制 使用了n的整次幂的canvas 需要修正计算uv
    local owner = self.renderer
    local w, h = IntToN2(owner.width), IntToN2(owner.height)
    local u = owner.width / w
    local v = owner.height / h
    return {
        0, 0,
        u, 0,
        u, v,
        0, v
    }
end

function AssemblerGraphic:setVertexDirty()
    Assembler.setVertexDirty(self)
    self.uvDirty = true
end